package com.kimi.abyss.rbac.controller;

import com.kimi.abyss.rbac.api.dto.UserInfo;
import com.kimi.abyss.rbac.api.pojo.SysUser;
import com.kimi.abyss.rbac.domain.User;
import com.kimi.abyss.rbac.service.UserService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Mono;

/**
 * no-op
 *
 * @author kimi
 * @date 2021/6/23
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
@Api(value = "user", tags = "用户管理模块")
public class UserController {

    private final UserService userService;

    @GetMapping("/info/{username}")
    public Mono<UserInfo> getUserInfo(@PathVariable("username") String username) {
        return userService.findByAccount(username)
                .map(UserInfo::new);
//        return null;
    }

    @GetMapping(value = "/{id}")
    public Mono<Void> getUser(@PathVariable Long id){
        return null;
    }

    @PostMapping(name = "")
    public void postUser(){

    }

    @PutMapping(name = "")
    public void putUser(){

    }

}
